package day03;

import java.util.Scanner;

public class HomeWork {
    public static void main(String[] args) {
        //1.运算符的练习：算术、关系、逻辑、赋值、字符串连接、条件
            //算术
        int a = 8,b = 8;
        a++;
        ++b;
        System.out.println(a);  //9
        System.out.println(b);  //9

        int a1 = 10,b1 = 10;
        a1--;
        --b1;
        System.out.println(a1);  //9
        System.out.println(b1);  //9

        int a2 = 10, b2 = 10;
        int a3 = a2++;
        int b3 = --b2;
        System.out.println(a2);  //11
        System.out.println(b2);  //9
        System.out.println(a3);  //10
        System.out.println(b3);  //9

            //关系
        int c = 5, c1 = 8, c2 = 10;
        System.out.println(c>c1);  //false
        System.out.println(c1<=c2);  //true
        System.out.println(c<=c2);  //true
        System.out.println(c1!=c2);  //true
        System.out.println(c+c1<c2);  //false
        System.out.println(c2/c<c1);  //true
        System.out.println(c++>c1);  //false

            //逻辑
        int d = 7, d1 = 8, d2 = 9;
        System.out.println(d+d1<d1+d2 && d+d2>d1+d2);  // true && false = false
        System.out.println(d2-d<d2-d1 || d+d1>d2);  // false || true = true
        System.out.println(!(d>d2));  // !false = true

            //赋值
        int e = 8;
        e += 5;
        System.out.println(e);  //13
        e -= 3;
        System.out.println(e);  //10
        e *= 4;
        System.out.println(e);  //40
        e /= 6;
        System.out.println(e);  //6
        e %= 2;
        System.out.println(e);  //0

            //字符串连接
                //输出“叔叔的名字叫张三，今年58岁了
                    String name = "张三";
                    int age = 58;
                    System.out.println("叔叔的名字叫"+name+"，今年"+age+"岁了");

                //同化作用
                    System.out.println(10+20+""+30);  //3030
                    System.out.println(""+10+20+30);  //102030
                    System.out.println(10+20+30+"");  //60

            //条件
                //满2000打5折，满1000不满2000打7折，满500不满1000打8折，不满500打9折:
                    double price = 1500;
                    if(price>=2000){
                        price *= 0.5;
                    }else if(price>1000){
                        price *= 0.7;
                    }else if(price>500){
                        price *= 0.5;
                    }else{
                        price *=0.9;
                    }
                    System.out.println("实付金额为："+price);

                    Scanner scan = new Scanner(System.in);
                      System.out.println("请选择功能：1.存款 2.取款 3.查询余额 4.退卡");
                      int commend = scan.nextInt();
                      switch (commend){
                         case 1:
                             System.out.println("存款");
                          break;
                         case 2:
                            System.out.println("取款");
                         break;
                         case 3:
                            System.out.println("查询余额");
                         break;
                        case 4:
                            System.out.println("退卡");
                         break;
                         default:
                             System.out.println("输入错误");
        }

    }
}
